//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/4/16.
//
#include <stdio.h>
int fun01(int n){
    int sub=1;
    while(n>=1){sub*=n;n--;}
    return sub;
}
int fun02(int n){
    if(n==1){return 1;}
    else{return  n*fun02(n-1);}

}
int main (){
    int n;
    scanf("%d",&n);
    printf("%d\n", fun01(n));
    printf("%d\n", fun02(n));
    return 0;
}